import service from "@/utils/request";


export async function pageList(page: number, size: number) {
    return await service({
        url: `/roles/` + page + '/' + size,
        method: 'get',
        // data
    })
}

export async function allList() {
    return await service({
        url: `/roles`,
        method: 'get',
        // data
    })
}

export async function remove(id: any) {
    return await service({
        url: `/roles/` + id,
        method: 'delete'
    })
}

export async function update(id: any, data: object) {
    return await service({
        url: `/roles/` + id,
        method: 'put',
        data
    })
}


export async function add(data: object) {
    return await service({
        url: `/roles`,
        method: 'post',
        data
    })
}

export async function permissions() {
    return await service({
        url: `/roles/permissions`,
        method: 'get',
        // data
    })

}